package com.ljh.aop.proxy;

/**
 * @author: Themberfue
 * @date: 2025/3/25 20:33
 * @description:
 */
// ! 代理模式，设计模式的一种
public class HouseProxy implements HouseSubject{
    HouseSubject realHouseSubject;

    public HouseProxy(HouseSubject realHouseSubject) {
        this.realHouseSubject = realHouseSubject;
    }

    @Override
    public void saleHouse() {
        System.out.println("我是中介, 我帮房东开始代理");
        realHouseSubject.saleHouse();
        System.out.println("我是中介, 我帮房东结束代理");
    }

    @Override
    public void rentHouse() {
        System.out.println("我是中介, 我帮房东开始代理");
        realHouseSubject.rentHouse();
        System.out.println("我是中介, 我帮房东结束代理");
    }
}
